package com.fadadianqi.logistics.sell.dao;

import com.fadadianqi.commons.BaseDAO;
import com.fadadianqi.logistics.sell.model.Bill;
import com.yeqiangwei.commons.util.Pagination;

import java.util.Date;
import java.util.List;

public interface BillDAO extends BaseDAO<Bill> {

    List<Bill> findAll(Pagination pagination);

    List<Bill> between(Date date1, Date date2, Pagination pagination);

    Double sumCostBetween(Date date1, Date date2);

    Double sumRealPayablesBetween(Date date1, Date date2);

    int countBetween(Date date1, Date date2);

    int countAll();

    List<Bill> findByVillageId(String villageId, Pagination pagination);

    int countByVillageId(String villageId);

    Double sumRealPayables(int year);

    Double sumCost(int year);

    List<Bill> findByCustomerId(String cid, Pagination pagination);

    int countByCustomerId(String cid);

    int countByTownId(String tid);

    List<Bill> findByTownId(String tid, Pagination pagination);

    int countAllWithIsReturn(Boolean isReturn);

    List<Bill> findAllWithIsReturn(Boolean isReturn, Pagination pagination);

    List<Bill> findAllWithIsChecked(Boolean isChecked, Pagination pagination);

    int countAllWithIsChecked(Boolean isChecked);

    List<Bill> between(Date date1, Date date2, String customerId,
                       Pagination pagination);

    int countBetween(Date date1, Date date2, String customerId);

    Double sumPurchase(int year);

}
